<extend name="Public:base" />
<block name="content">
<div class="page-header">
		<h1>
			{$breadcrumb2}
			<small>
				<i class="icon-double-angle-right"></i>
				{$crumbs}
			</small>

		</h1>
	</div>
	<div class="row">
	<div class="col-xs-12">	
	
        <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="validation-form" class="form-horizontal">
        
	        <notempty name="Think.get.id">
				<input name="tr_id" type="hidden" value="{$Think.get.id}" />
			</notempty>      				
			
			<div class="form-group">
				<label class="col-sm-2 control-label no-padding-left"> * 关键字 </label>
			<div class="col-sm-10">
				<div class="clearfix">
					<input name="keyword" id="keyword" class="col-xs-10 col-sm-5" placeholder="关键字" value="{$reply.keyword|default=''}" type="text">
				</div>
			</div>
			</div>
			
			<div class="form-group">
				<label class="col-sm-2 control-label"> * 回复内容</label>
				<div class="col-sm-10">
					<div class="clearfix">
						<textarea id="content" class="form-control" placeholder="回复内容" rows="5" name="content">{$reply.content|default=''}</textarea>
					</div>
				</div>
			</div>
			
			<div class="form-group">
				<label class="col-sm-2 control-label">启用</label>
				<div class="col-sm-10">
					<label class="radio-inline">
					<input type="radio" checked="checked" value="1" name="status">是</label>
					<label class="radio-inline">
					<input type="radio" value="0" name="status">否</label>
				</div>
			</div>	          	
          	
          	<div class="form-group">
				<label class="col-sm-1 control-label no-padding-left"> </label>	
				<div class="col-sm-11">
					<input name="send" type="submit" value="提交" class="btn btn-primary" />
				</div>
			</div>
          	
        </form>

	</div>
</div>
</block>
<block name="javascript">
<script src="__JS__/jquery.validate.min.js"></script>
<script>		
$(function(){
	
	<present name="Think.get.id">
			Oscshop.setValue("status", {$reply.status|default=1});		
	</present>
	
	$('#validation-form').validate({
			errorElement: 'div',
			errorClass: 'help-block',
			focusInvalid: false,
			rules: {				
				keyword: {
					required: true,
					minlength: 1
				},			
				content: {
					required: true					
				}	
			},
	
			messages: {
				
				keyword: {
					required: "必填",
					minlength: "不得少于1个字"
				},
				content: {
					required: "必填"					
				}
			},
	
			
	
			highlight: function (e) {
				$(e).closest('.form-group').removeClass('has-info').addClass('has-error');
			},
	
			success: function (e) {
				$(e).closest('.form-group').removeClass('has-error').addClass('has-info');
				$(e).remove();
			},
	
			errorPlacement: function (error, element) {
				 error.insertAfter(element.parent());
			},

		});

});
	
</script>
</block>